#pragma once

#include "GenericTestProtocol.h"

namespace CO { namespace SpiFoundation { namespace RoomFW {

//
// TODO:  Add a smart pointer typedef for your class.
//
class IEchoServer;
typedef ::boost::shared_ptr<IEchoServer> IEchoServerSP;

//
// Interface definition.
//
class IEchoServer :	public virtual IActiveObject
{
public:

	//
	// "Factory Method" to hide implementation details.
	//
	static IEchoServerSP Create(const char* objectName);

	//
	// TODO:  Add an enumeration value for each port.
	//
	enum PortEnum 
	{
		PORT_ECHO_IN,
		PORT_ECHO_OUT,
		PORT_COUNT,				// Number of user defined ports.
		PORT_TIMER = PORT_COUNT // Port index used to handle timer messages.
	};

	//
	// Static array used to assign port priorities in the same order ports are
	// named above.  Must have PORT_COUNT + 1 Elements.  Last element for timer.
	//
	static const PortPriority PortPriorities[];
	static const size_t PortPrioritiesSize;

	//
	// Constructor/Destructor.
	//
	IEchoServer(void);
	virtual ~IEchoServer(void);

	//
	// IActiveObject overrides.
	//
	virtual const char* getPortName(size_t portIndex) const;
	SpiFoundation::RoomFW::IContractCheckerSPC getContractChecker(SpiFoundation::RoomFW::PortIndex portIndex) const;

private:

	//
	// TODO:  Add a protocol member for each port to return from getContractChecker()
	//			rather than dynamically allocating a new one each time.
	//
	GenericTestProtocol inProtocol_;
	GenericTestProtocol outProtocol_;
};

}}}